package edu.sctu.zhengsenwen.month201506.day20150624;

import javax.imageio.ImageIO;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.net.URL;

/**
 * Created by user15 on 2015/6/28.
 */
public class GameUtil {

    public static  Image getImage(String path){
        URL url = GameUtil.class.getClassLoader().getResource(path);
        BufferedImage bufferedImage = null;

        try{
            bufferedImage = ImageIO.read(url);

        }catch (IOException e) {
            e.printStackTrace();
        }

        return bufferedImage;
    }
}
